#{include file="../Common/Header.html"}
<div class="layui-container fly-marginTop fly-user-main">
    #{include file="../Common/Nav.html"}
    <div class="fly-panel fly-panel-user" pad20>
        <div class="layui-tab layui-tab-brief">
            #{include file="../Common/SecurityNav.html"}
            <div class="content-body">
                <form class="layui-form form-data">
                    <div class="form-block">
                        <div>
                            <div class="form-header">旧密码</div>
                            <div class="form-body"><input type="password" name="old_password" autocomplete="off"
                                                          class="layui-input" placeholder="旧密码"
                                                          style="color: #ff9191;width: 320px;"></div>
                        </div>

                        <div>
                            <div class="form-header">新密码</div>
                            <div class="form-body"><input type="password" name="password" autocomplete="off"
                                                          class="layui-input" placeholder="新密码"
                                                          style="color: #ff9191;width: 320px;"></div>
                        </div>

                        <div>
                            <div class="form-header">确认新密码</div>
                            <div class="form-body"><input type="password" name="re_password" autocomplete="off"
                                                          class="layui-input" placeholder="确认新密码"
                                                          style="color: #ff9191;width: 320px;"></div>
                        </div>


                        <div style="margin-top: 25px;">
                            <button type="button" class="layui-btn layui-btn-pink save-data">保存修改</button>
                        </div>

                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        layui.use(['layer'], function () {
            $('.save-data').click(function () {
                User.$post("/user/api/security/password", $('.form-data').serialize(), res => {
                    layer.msg("修改成功");
                    setTimeout(() => {
                        window.location.reload();
                    }, 1500);
                })
            });
        });
    });

</script>
#{include file="../Common/Footer.html"}
